<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登陆</title>
    <link rel="stylesheet" href="./css/login.css">
</head>
<body>
    <div class="app">
        <!-- 头部 -->
        <div class="header">
            <div class="back backColor">
                <a href="./my.html"> <span>&lt;</span> 返回</a>
            </div>
            <div class="title fontBig">
                登陆
            </div>
        </div>

        <form>
            <p>
                <label for="user">用户名</label>
                <input type="text" class="user" id="user">
            </p>
            <p>
                <label for="psd">密 码</label>
                <input type="text" class="psd" id="psd">
            </p>
            <input type="button" value="提交" class="loginBtn">
        </form>
    </div>
    
</body>
<script src="./js/jquery-3.7.1.min.js"></script>
<script src="./js/login.js"></script>
<script src="./js/util.js"></script>
<script>
        myPromiseAjax({
        url: 'http://39.105.198.203:3001/prod/index',
    }).then(data => {

        list.innerHTML = ''; // 清空书籍列表
        console.log(data.data.list);
        // 生成茶列表
        for (let i = 0; i < data.data.list.length; i++) {
            // 使用 data.data.list[i].tid 作为链接的 ID
            list.innerHTML += `<li>
                    <a href='./detail.html?tid=${i + 1}'>
                        <div class="liBox">
                            <div class="ioc">
                                <img src=${data.data.list[i].fullSrc} alt="">
                            </div>
                            <div class="text">
                                <div class="teaName">${data.data.list[i].tname}</div>
                                <div class="teaPrice">¥ <span class="fontBig">${data.data.list[i].price}</span> .00</div>
                            </div>
                        </div>
                    </a>
                </li>`;
        }

    }).catch(err => {

    });
</script>

</html>